Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PCP-208) ThreadContainer associates names to threads #322

Merged
merged 3 commits into from
Feb 4, 2016

Conversation

parisiale
Copy link
Contributor

No description provided.

parisiale added 3 commits February 4, 2016 15:41
Deleting also the copy assignment.
When adding a thread objecty to a ThreadContainer instance, the user must
also specify the name of the thread. This enables inspection.

Using an unsorted_map instead of a vector to store the thread instances;
this enables the retrieval by name.

Raising an Error in case ThreadContainer::add is called for an existent
name.

Adding find() and getThreadNames() methods.

Making const member functions where possible.

Adding new unit tests.

Updating RequestProcessor to comply with the new interface and with the
possibility of having stored a thread with the same name (using a mutex
for that). For a given non-blocking request, it's execution thread will
be named against the transaction_id.
ThreadContainer(const std::string& name = "",
uint32_t _check_interval = THREADS_MONITORING_INTERVAL_MS,
uint32_t _threads_threshold = THREADS_THRESHOLD);
ThreadContainer(const ThreadContainer&) = delete;
ThreadContainer& operator=(const ThreadContainer&) = delete;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you disabling the constructors (and the = operator)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the rule of 3 plus threads are not copiable.

@mruzicka
Copy link
Contributor

mruzicka commented Feb 4, 2016

LGTM

mruzicka added a commit that referenced this pull request Feb 4, 2016
(PCP-208) ThreadContainer associates names to threads
@mruzicka mruzicka merged commit 6258d61 into puppetlabs:master Feb 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants